<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue 组件props通信类型</title>
</head>
<style>
    .template {
        margin: 5% 10%;
    }
</style>
<body>
<div id="app">
    <div class="template">
        <html-component1 v-bind:param1="text"></html-component1>
        <html-component1 v-bind:param1="array"></html-component1>
        <html-component1 v-bind:param1="object"></html-component1>
        <html-component1 v-bind:param1="boolean"></html-component1>
        <html-component1 v-bind:param1="number"></html-component1>
    </div>
</div>

<script src="../js/vue.js"></script>
<script>

    const message = {
        text: '请输入身份号',
        array: [1, 2, 3, 4, 5, 6],
        object: {
            username : '张三',
            password : '123456',
        },
        boolean: true,
        number : 10000,
    };


    const vue_child = {
        data() {
            return {
                message: 'vue_child局部组件'
            }
        },
        template: `
          <h4>
              <div>
                    props的param1为==>{{ param1 }}
              </div>
          </h4>
        `,
        props: ['param1']
    }


    const demo = new Vue({
        el: '#app',
        data: message,
        methods: {},
        computed: {},
        components: {
            'html-component1': vue_child,
        }
    });
</script>
</body>
</html>